package com.briup.jd2511.jd2511bookstore.exception;


import com.briup.jd2511.jd2511bookstore.response.ResultCode;
import lombok.Getter;

/**
 * 自定义service层异常类
 */
@Getter
public class ServiceException extends RuntimeException {

    @Getter
    private static final long serialVersionUID = 1L;

    private ResultCode resultCode;

    public ServiceException(ResultCode resultCode) {
        this(resultCode.msg());
        this.resultCode = resultCode;
    }

    private ServiceException(String message) {
        super(message);
    }

    public void setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

}
